package cn.jdy.task.service.classify;

import java.util.List;

import cn.jdy.framework.log.BaseLog;
import cn.jdy.payment.service.OrderService;
import cn.jdy.plugins.entity.Website;
import cn.jdy.plugins.service.WebsiteService;
import cn.jdy.task.service.SchedulerService;
import cn.jdy.task.service.TaskGroup;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

@TaskGroup("订单超时自动关闭")
public class WebsiteCancel implements Job {
	@Autowired
	private WebsiteService websiteService;


	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			JobDataMap map = context.getTrigger().getJobDataMap();
			String param = map.getString("strParam");
		  List<Website> listwebsite=websiteService.findAll();
      Website sps=listwebsite.get(0);
      sps.setDaysum(0);
      websiteService.update(sps);
		} catch(Exception e) {
			BaseLog.e(this.getClass(), "invoke", e);
		}
	}

}
